home *** CD-ROM | disk | FTP | other *** search
- REM ::ExeType=Windows
- REM ::ExePath=L:\IPE_WIN.EXE
-
- ' *****************************************************************************************************************************
- ' DCL Install program for IPE/McAfee CD-ROM
- '
- ' ******************************************************************************************************************************
- ' Copyright 1994 - IPE Corporation
- ' ******************************************************************************************************************************
-
- Sub main()
-
- On Error goto errortrap
-
- dim Products$(13) as string ' Define product array
- dim Program$(12) as string ' Define product install programs
- dim Location$(12) as String ' Define where they all are
- dim WinApp$ () as string ' Define list for active windows
-
- ' ******************************************************************************************************************************
- ' Miscellaneous variables and initialisations
- ' ******************************************************************************************************************************
-
- Disk$="" ' Drive letter for CD
- Edit$="notepad.exe" ' Usual display editor - if file too large, switches to Write
- Trigger$=":\ipe_win.exe" ' Check to see if CD mounted
- Document$="\oview.txt" ' Overview Document for each product
- OutString$=""
- Loop%=TRUE
- Notepad$=""
- Write$=""
- WallPaper$=ReadIni$("Desktop","Wallpaper") ' Record current Windows Wallpaper
- Tile$=ReadIni$("Desktop","TileWallpaper") ' and tile option
-
- ' ******************************************************************************************************************************
- ' Setup product arrays and pathnames
- ' ******************************************************************************************************************************
-
- Products$(0)="BrightWorks" ' Product NAME array
- Products$(1)="NetTools"
- Products$(2)="VirusScan"
- Products$(3)="NetShield"
- Products$(4)="LAN Support Centre"
- Products$(5)="HELP Plus"
- Products$(6)="SiteMeter"
- Products$(7)="LAN Inventory"
- Products$(8)="NetRemote"
- Products$(9)="ProtecNet"
- Products$(10)="Other Products"
- Products$(11)="Other Information"
- Products$(12)="Presentation"
-
- Program$(0)="bri120e\disk1\setup.exe" ' Product INSTALL program array
- Program$(1)="nt51e\disk1\setupm.exe"
- Program$(2)="scan\install.bat"
- Program$(3)="netshld"
- Program$(4)="lsc301e\disk1\setup.exe"
- Program$(5)="hplus20e\disk1\setup.exe"
- Program$(6)="smr43e\disk1\setup.exe"
- Program$(7)="lai313e\disk1\setup.exe"
- Program$(8)="nr521e\disk1\setup.exe"
- Program$(9)="protec\netinst.exe"
- Program$(10)="n/a"
- Program$(11)="n/a"
-
- Location$(0)="bri120e\disk1" ' Product LOCATION array
- Location$(1)="nt51e\disk1"
- Location$(2)="scan"
- Location$(3)="netshld"
- Location$(4)="lsc301e\disk1"
- Location$(5)="hplus20e\disk1"
- Location$(6)="smr43e\disk1"
- Location$(7)="lai313e\disk1"
- Location$(8)="nr521e\disk1"
- Location$(9)="protec"
- Location$(10)="other"
- Location$(11)="misc"
-
- ' *****************************************************************************************************************************
- ' Setup main dialog box
- ' *****************************************************************************************************************************
- Begin Dialog UserDialog 84,24,305,281, "IPE - McAfee FULL Function Evaluation Product"
- OptionGroup .OptionGroup1
- OptionButton 30,50,72,14, "BrightWorks"
- OptionButton 30,65,48,14, "NetTools"
- OptionButton 30,80,48,14, "VirusScan"
- OptionButton 30,95,48,14, "NetShield"
- OptionButton 30,110,84,14, "LAN Support Centre"
- OptionButton 30,125,48,14, "HELP Plus"
- OptionButton 30,140,48,14, "SiteMeter"
- OptionButton 30,155,80,14, "LAN Inventory"
- OptionButton 30,170,48,14, "NetRemote"
- OptionButton 30,185,80,14, "ProtecNet"
- OptionButton 30,200,80,14, "Other Products"
- OptionButton 30,215,80,14, "Other Information"
- OptionButton 30,230,90,14, "Presentation"
- PushButton 177,120,73,16, "Product Install"
- PushButton 177,75,73,16, "View Information"
- PushButton 240,252,41,14, "Exit"
- Text 173,56,73,8, "3. Select the Option"
- Text 15,38,79,8, "2. Select the Product"
- Text 4,256,231,8, "For licensed product - CONTACT YOUR LOCAL DEALER or Ring IPE"
- Text 180,150,80,8, "IPE Corporation Ltd"
- Text 180,160,58,8, "9, Alfred Place,"
- Text 180,170,43,8, "LONDON"
- Text 180,180,43,8, "WC1E 7EB"
- Text 180,200,79,8, "Tel: 0171 436 2244"
- Text 180,210,79,8, "Fax: 0171 916 1004"
- Text 180,220,79,8, "BBS: 0171 916 1025"
- Text 15,10,140,8, "1. Click here for an Introduction 'Readme' "
- PushButton 175,9,73,16, "Readme First"
- PushButton 177,97,73,16, "Documentation"
- End Dialog
-
- ' ****************************************************************************************************************************
- ' Setup Install request after readme
- ' ****************************************************************************************************************************
- Begin Dialog UserDialog2 258,136,126,105, "IPE - McAfee Install"
- Text 3,17,116,8, "Do you wish to install the product?"
- PushButton 40,47,41,14, "No"
- PushButton 40,73,41,14, "Yes"
- End Dialog
-
- ' ****************************************************************************************************************************
- ' Set up arrays for dialog response
- ' ****************************************************************************************************************************
-
- Dim Choice as UserDialog
- Dim Choice2 as UserDialog2
- Dim DDrives$() as string
-
- ' ****************************************************************************************************************************
- ' MAIN CODE BEGINS......... sort out the basics, CD drive letter, either Notepad or Write or both
- ' ****************************************************************************************************************************
-
- DiskDrives DDrives$ ' Find out what disks are available
- For i% = lbound(DDrives$) to ubound(DDrives$)
- if Notepad$="" then ' There HAS to be someone who doesn't have Notepad in Windows!
- if FileExists (DDrives$(i%)+":\windows\notepad.exe") then
- Notepad$=DDrives$(i%)+":\windows\notepad.exe"
- end if
- end if
- if Write$="" then ' There HAS to be someone who doesn't have Write in Windows
- if FileExists (DDrives$(i%)+":\windows\write.exe") then
- Write$=DDrives$(i%)+":\windows\write.exe"
- end if
- end if
- if FileExists(DDrives$(i%)+Trigger$) then ' This is the CD drive letter - ie where ipe_win.exe lives
- Disk$=LCase$(DDrives$(i%)+":\") ' make sure the :\ is present
- end if
- next i%
- if Notepad$="" AND Write$="" then
- MsgBox "Please install Windows Notepad and Write before continuing!",16,"Catch 22!"
- goto Out ' Cannot go on without SOME way to display text!!!!!!!!!!
- end if
- if Notepad$="" then
- Notepad$=Write$ ' Needs one .........
- end if
- if Write$="" then
- Write$=Notepad$ ' ............. or the other!
- end if
- If Disk$="" then ' No drive letter for CD-ROM found - try again
- MsgOpen "Put the IPE CD-ROM in the drive and re-start",0,FALSE,FALSE
- Sleep 3000
- MsgClose ' Exit if CD not found
- goto Out
- end if
-
- ' ****************************************************************************************************************************
- ' Minimise current Windows applications, save current wallpaper and put up IPE logo
- ' ****************************************************************************************************************************
-
- AppName$=AppGetActive$() ' Get active Application
- AppList WinApp$
- For i%=lbound(WinApp$) to ubound(WinApp$)
- AppMinimize WinApp$(i%)
- next i% ' Minimize all current windows
- DesktopSetWallpaper Disk$+"ipe-c.bmp", true ' Replace wallpaper with IPE logo
-
- OutString$="This Install program was written in Desktop Control Language (DCL) "
- MsgOpen OutString$,10,FALSE,FALSE
- Sleep 3000
- OutString$="DCL is an Application Programming Language included with NetTools"
- MsgSetText OutString$
- Sleep 5000
- MsgClose ' Advertise DCL......
-
- ' ****************************************************************************************************************************
- ' MAIN PROGRAM LOGIC BEGINS........
- ' ****************************************************************************************************************************
-
- While Loop%
- a%=Dialog(Choice) ' Put up Main dialog screen
-
- Install: ' Return point for install after read
- select case a%
-
- ' ****************************************************************************************************************************
- ' INSTALL option
- ' ****************************************************************************************************************************
- case 1
-
- if Choice.OptionGroup1=3 then ' but not for NetShield - special case
- Serv$=AskBox$("On which Server is NetShield to be Installed? ")
- if Serv$="" then ' Need to determine which server for NS NLMs
- goto Wendy
- end if
- GetNet:
- Net$=AskBox$("Which Revision of NetWare is "+Serv$+" - 3.x or 4.x? ")
- if Net$="" then
- goto GetNet
- end if
- Net$=Mid$(Net$,1,1)
- Name$=NetUserName$(Serv$) ' logged in as ??
- MsgBox "You are logged in as "+Name$+" on server "+Serv$
- if Name$ <> "SUPERVISOR" then ' Should be SUPERVISOR for access
- MsgBox "You must be logged in as 'SUPERVISOR' on "+Serv$+" to install NetShield",0,"NSInstall"
- goto wendy
- end if
-
- For i% = lbound(DDrives$) to ubound(DDrives$) ' generate list of drive letters
- AllDrives$=AllDrives$+DDrives$(i%) ' for Attach to get to SYS: volume
- next i%
- FreeDrive$=AskBox$("Chose a drive NOT in this current list",AllDrives$)
- if FreeDrive$="" then ' select a non-used letter
- goto Wendy
- end if
- FreeDrive$=Mid$(FreeDrive$,1,1)+":" ' make sure the : is there
- if NetConnectDrive (FreeDrive$,Serv$+"\sys:\system") then
- MsgOpen "Copying "+Disk$+Program$(3)+"\*.* to "+FreeDrive$+"\system........ ",0,FALSE,FALSE
- Part1=FileCopy(Disk$+Program$(3)+"\*.*",FreeDrive$+"\system") ' general files
- Part2=FileCopy(Disk$+Program$(3)+"\netware."+Net$+"\*.*",FreeDrive$+"\system") ' NetWare version specific files
- if Part1 AND Part2 then
- MsgSetText "File Copy successful - Load NetShield (NETSHLD.NLM) at Console"
- Sleep 5000
- MsgClose
- else
- MsgSetText "File Copy Failed! Check access rights."
- Sleep 2000
- MsgClose
- end if
- if NOT NetDisConnectDrive(mid$(FreeDrive$,1,1)) then ' disconnect drive
- MsgBox "Drive Disconnect Failed!"
- end if
- else
- MsgBox "Drive Connect failed - check which drives are available"
- end if
- goto Wendy
- end if
-
- ' ****************************************************************************************************************************
- ' Special action for OTHER and MISCELLANEOUS
- ' ****************************************************************************************************************************
-
- if Choice.OptionGroup1>=10 then
- Msgbox "Select '"+Products$(Choice.OptionGroup1)+"' and the 'View Information' box",0,Products$(Choice.OptionGroup1)
- goto Wendy
- end if
-
- ' ****************************************************************************************************************************
- ' Warning about NetTools Custom install
- ' ****************************************************************************************************************************
-
- if Choice.OptionGroup1= 1 then
- MsgOpen" ",0,FALSE,FALSE
- MsgSetText "FULL install only - for CUSTOM install, see NetTools 'View Information' "
- Sleep 5000 ' set up big empty box first
- MsgClose ' then put text in.......
- end if
-
- ' ****************************************************************************************************************************
- ' Main INSTALL code
- ' ****************************************************************************************************************************
-
- OutString$="Execute Install of "+Products$(Choice.OptionGroup1)+"?"
- if msgbox(OutString$,4,"IPE - McAfee Install") = 6 then ' standard install of product
- if FileExists(Disk$+Program$(Choice.OptionGroup1)) then ' if file exists!
- if Choice.OptionGroup1=2 then
- taskid%=shell(Disk$+Program$(2)+" "+disk$,3)
- else
- if Choice.OptionGroup1=9 then ' Kludge for Protec to see .INF
- ChDrive Disk$
- ChDir Disk$+"protec"
- end if
- taskid%=shell(Disk$+Program$(Choice.OptionGroup1),3)
- end if
-
- ' ****************************************************************************************************************************
- ' Wait code for NetTools and HelpPlus
- ' ****************************************************************************************************************************
-
- if Choice.OptionGroup1= 1 OR Choice.OptionGroup1 = 5 then
- WaitForTaskCompletion taskid%
- end if
- else
- MsgOpen "File does not exist or is missing!",0,FALSE,FALSE
- Sleep 2000
- MsgClose
- goto Wendy ' Blunder... install file missing
- end if
- end if
-
- ' ****************************************************************************************************************************
- ' INFORMATION option
- ' ****************************************************************************************************************************
-
- case 2
-
- if Choice.OptionGroup1=12 then
- MsgOpen "Please wait, presentation loading..............",0,FALSE,FALSE
- ChDrive Disk$
- ChDir Disk$+"misc"
- taskid%=shell(Disk$+"misc\pptview ")
- WaitForTaskCompletion taskid%
- MsgClose
- goto Wendy
- end if
- NextFile: ' back for next file in list
- if Choice.OptionGroup1=10 OR Choice.OptionGroup1=11 then ' misc and other need file list
- ChDrive Disk$
- ChDir "\"+Location$(Choice.OptionGroup1)
- File$=OpenFileName$("Read Me Files","All Files:*.txt,*.doc") ' File list to select
- else
- File$=Disk$+Location$(Choice.OptionGroup1)+Document$
- end if
- if File$="" then
- goto Wendy
- end if
- if FileExists (File$) then
- if FileLen (File$) < 40960 then ' notepad or edit?
- taskid%=shell(Edit$+" "+File$,3) ' depends on file size
- else
- taskid%=shell("write "+FILE$,3)
- end if
- WaitForTaskCompletion taskid% ' stay with editor
- if Choice.OptionGroup1=10 OR Choice.OptionGroup1=11 then
- goto NextFile ' look at another one?
- end if
- else
- MsgOpen "File does not exist or is missing!",0,FALSE,FALSE
- Sleep 2000
- MsgClose
- goto Wendy ' Blunder - file does not exist
- end if
-
- ' ****************************************************************************************************************************
- ' Install after reading about it?
- ' ****************************************************************************************************************************
-
- if Choice.OptionGroup1 < 10 then ' only for installable products
- b%=Dialog(Choice2)
- select case b%
- case 2
- a%=1 ' set up for case 1 option in main loop
- goto Install ' go for it
- case 1
- MsgOpen "Returning to main Menu",10,FALSE,FALSE
- sleep 500
- MsgClose ' otherwise go back to main menu
- end select
- end if
-
- ' ****************************************************************************************************************************
- ' EXIT option
- ' ****************************************************************************************************************************
-
- case 3
-
- OutString$="Copyright IPE 1994"
- MsgOpen OutString$,10,FALSE,FALSE
- Sleep 2000
- OutString$=" Goodbye"
- MsgSetText OutString$
- Sleep 2000
- MsgClose
- Loop%=FALSE ' logic to exit outer WHILE loop
-
- ' ****************************************************************************************************************************
- ' README.1ST option
- ' ****************************************************************************************************************************
-
- case 4
-
- taskid%=shell (Notepad$+" "+Disk$+"misc\readme.1st",3)
- WaitForTaskCompletion taskid%
-
- ' ****************************************************************************************************************************
- ' DOCUMENTATION option
- ' ****************************************************************************************************************************
-
- case 5
-
- if Choice.OptionGroup1 < 10 then
- if MsgBox("Documentation is in "+Disk$+Location$(Choice.OptionGroup1)+" - Do you wish to view now?",4,"Documentation") = 6 then
- MsgClose
- ChDrive Disk$
- ChDir "\"+Location$(Choice.OptionGroup1)
- Again:
- File$=OpenFileName$("Read Me Files","All Files:*.txt,*.doc") ' get file list to view
- if File$="" then
- goto Wendy
- end if
- else
- goto Wendy
- end if
- if FileExists (File$) then
- if FileLen (File$) < 40960 then ' notepad or edit?
- taskid%=shell(Notepad$+" "+File$,3)
- else
- taskid%=shell(Write$+" "+FILE$,3)
- end if
- WaitForTaskCompletion taskid% ' wait for the editor
- goto Again ' chose another file?
- end if
- else
- a%=2 ' or install product.....
- goto Install
- end if
- ' ****************************************************************************************************************************
-
- end select
-
- ' ****************************************************************************************************************************
- ' End of MAIN logic loop
- ' ****************************************************************************************************************************
-
- Wendy:
- Wend
-
- ' ****************************************************************************************************************************
- ' PROGRAM NORMAL END
- ' Put back original Windows bits and pieces
- ' ****************************************************************************************************************************
-
- Out:
- on error goto 0 ' Don't want any errors at this late stage
- DesktopSetWallpaper WallPaper$,Val(Tile$) ' Replace old wallpaper
- AppRestore AppName$
- AppActivate AppName$ ' Put back last active App
- end ' Go Home!
-
- ' ****************************************************************************************************************************
- ' No one wants to come here................................
- ' ****************************************************************************************************************************
-
- Errortrap: ' To catch the X factor!!!
- MsgBox "Error: "+str$(err())+" - "+Error$(err())+"taskid%="+str$(taskid%),0,"Error"
- DesktopSetWallpaper WallPaper$,Val(Tile$)
- on error goto 0 ' turn off error traps before exit
- end
-
- ' ****************************************************************************************************************************
- end sub ' HORRAY!!!!!!!!
-